package org.appfuse.dao;

/**
 * 
 * @author <a href="mailto: baiyibing@gmail.com">王锤</a>
 * @version $Revision$
 * 
 */

import java.io.Serializable;
import java.util.Map;
import java.util.Set;

import org.apache.commons.lang.builder.CompareToBuilder;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class EnhancedHql implements Comparable, Serializable {
	protected final Log log = LogFactory.getLog(getClass());

	private String sql;
	
	public String getSql() {
		return sql;
	}

	public void setSql(String sql) {
		this.sql = sql;
	}

	private String hql;
	private Set paramSet;

	public Set getParamSet() {
		return paramSet;
	}

	public void setParamSet(Set paramSet) {
		this.paramSet = paramSet;
	}

	private Map paramMap;
	private String[] paramNames;

	public String getHql() {
		return hql;
	}

	public void setHql(String hql) {
		this.hql = hql;
	}

	public Map getParamMap() {
		return paramMap;
	}

	public void setParamMap(Map paramMap) {
		this.paramMap = paramMap;
	}

	public String[] getParamNames() {
		return paramNames;
	}

	public void setParamNames(String[] paramNames) {
		this.paramNames = paramNames;
	}

	public Object[] getValues() {
		return values;
	}

	public void setValues(Object[] values) {
		this.values = values;
	}

	private Object[] values;

	/**
	 * @see java.lang.Comparable#compareTo(Object)
	 */
	public int compareTo(Object object) {
		EnhancedHql myClass = (EnhancedHql) object;
		return new CompareToBuilder().append(this.values, myClass.values)
				.append(this.paramMap, myClass.paramMap).append(this.paramSet,
						myClass.paramSet).append(this.hql, myClass.hql).append(
						this.paramNames, myClass.paramNames).toComparison();
	}

}
